#include <xp/utl/log.h>
#include <xp/bas/stdio.h>

#define XP_LOG(log,msg,type,xxxxx);
int xp_main ()
{
	xp_log_t log;

	if (xp_log_open(&log, XP_TEXT("app"), 
		XP_LOG_SYSLOG | XP_LOG_FILE | 
		XP_LOG_CONSOLE | XP_LOG_DEBUG, XP_TEXT("log.log")) == XP_NULL) {
		xp_printf (XP_TEXT("cannot open log\n"));
		return -1;
	}

	xp_log_report (&log, XP_TEXT("log"), XP_LOG_ERROR, XP_TEXT("started"));
	xp_log_report (&log, XP_TEXT("log"), XP_LOG_ERROR, 
		XP_TEXT("[%s - %s - %-10.5d]"), XP_TEXT("long messagess..."), XP_TEXT("second message"), -20);

	xp_log_set_target (&log, XP_LOG_CONSOLE);
	xp_log_set_priority (&log, XP_LOG_DEBUG);
	xp_log_report (&log, XP_TEXT("log"), XP_LOG_DEBUG, 
		XP_TEXT("[%20s - %s]"), XP_TEXT("long messagess..."), XP_TEXT("second message"));

	xp_log_close (&log);
	return 0;
}
